package com.dreamcar.auction.entity;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * DestinationCarRelationId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class DestinationCarRelationId implements java.io.Serializable {

	// Fields

	private Integer destinationMarketIdDestinationMarket;
	private Integer carModelIdCarModel;

	// Constructors

	/** default constructor */
	public DestinationCarRelationId() {
	}

	/** full constructor */
	public DestinationCarRelationId(
			Integer destinationMarketIdDestinationMarket,
			Integer carModelIdCarModel) {
		this.destinationMarketIdDestinationMarket = destinationMarketIdDestinationMarket;
		this.carModelIdCarModel = carModelIdCarModel;
	}

	// Property accessors

	@Column(name = "destination_market_ID_DESTINATION_MARKET", nullable = false)
	public Integer getDestinationMarketIdDestinationMarket() {
		return this.destinationMarketIdDestinationMarket;
	}

	public void setDestinationMarketIdDestinationMarket(
			Integer destinationMarketIdDestinationMarket) {
		this.destinationMarketIdDestinationMarket = destinationMarketIdDestinationMarket;
	}

	@Column(name = "car_model_ID_CAR_MODEL", nullable = false)
	public Integer getCarModelIdCarModel() {
		return this.carModelIdCarModel;
	}

	public void setCarModelIdCarModel(Integer carModelIdCarModel) {
		this.carModelIdCarModel = carModelIdCarModel;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof DestinationCarRelationId))
			return false;
		DestinationCarRelationId castOther = (DestinationCarRelationId) other;

		return ((this.getDestinationMarketIdDestinationMarket() == castOther
				.getDestinationMarketIdDestinationMarket()) || (this
				.getDestinationMarketIdDestinationMarket() != null
				&& castOther.getDestinationMarketIdDestinationMarket() != null && this
				.getDestinationMarketIdDestinationMarket().equals(
						castOther.getDestinationMarketIdDestinationMarket())))
				&& ((this.getCarModelIdCarModel() == castOther
						.getCarModelIdCarModel()) || (this
						.getCarModelIdCarModel() != null
						&& castOther.getCarModelIdCarModel() != null && this
						.getCarModelIdCarModel().equals(
								castOther.getCarModelIdCarModel())));
	}

	public int hashCode() {
		int result = 17;

		result = 37
				* result
				+ (getDestinationMarketIdDestinationMarket() == null ? 0 : this
						.getDestinationMarketIdDestinationMarket().hashCode());
		result = 37
				* result
				+ (getCarModelIdCarModel() == null ? 0 : this
						.getCarModelIdCarModel().hashCode());
		return result;
	}

}